Labels
What does it do?
Manages labels on a chat. You can perform exactly one of three operations per node:
add— appends label(s) to the current onesremove— removes label(s) from current labelsset— replaces all current labels with the specified list (use an empty array to clear all labels)
1. Syntax
<node_name>:
type: func
func_type: chat
func_id: labels
params:
add:
- "<label id>"
on_complete: <next_node>
required params
typetype of the nodefunc_typehere it will be a chat functionfunc_idwhat function are we calling (labels)paramswith exactly one of:add,remove, orsetaddarray of label IDs to append (at least 1)removearray of label IDs to remove (at least 1)setarray of label IDs to replace all current labels (can be empty)
on_completenext node after complete
optional params
on_failurefallback nodedepartmentassigns the chat to a departmentagentassigns the chat to a specific agent (email address or CRM ID as defined in the Texter agents manager)
2. Examples
Add a single label
add_urgent_label:
type: func
func_type: chat
func_id: labels
params:
add:
- "urgent"
on_complete: handoff
Add multiple labels
Adding "important" and "needs_followup" to a chat that already has "new_lead" results in all three labels: "new_lead", "important", "needs_followup".
add_labels:
type: func
func_type: chat
func_id: labels
params:
add:
- "important"
- "needs_followup"
on_complete: handoff
Remove a label
Removing "new_lead" from a chat with "new_lead", "important", "needs_followup" leaves "important" and "needs_followup".
remove_label:
type: func
func_type: chat
func_id: labels
params:
remove:
- "new_lead"
on_complete: existing_customer_menu
Set labels (replaces all existing)
Setting "only_one" replaces whatever labels the chat currently has — the result is only "only_one".
set_label:
type: func
func_type: chat
func_id: labels
params:
set:
- "only_one"
on_complete: handoff
Clear all labels
clear_labels:
type: func
func_type: chat
func_id: labels
params:
set: []
on_complete: main_menu
If any label ID in the list does not exist, the entire operation fails — even if other labels in the list are valid. For example, if you add "vip" and "tel aviv" but "tel aviv" doesn't exist as a label, neither label will be added.
If some labels might not exist, add them one at a time in separate nodes so that a missing label doesn't block the others.
You cannot combine add, remove, and set in the same node. Each node accepts exactly one operation. If you need to add some labels and remove others, use separate nodes.